﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NJL.Web.Controls
{
    public partial class WUCIndexEatLivePlayShop : BaseUserControl
    {
        private readonly BLL.NJL_COMPANY_SERVICE bll = new BLL.NJL_COMPANY_SERVICE();
        protected IList<Model.NJL_COMPANY_SERVICE> LIST_EAT;
        protected IList<Model.NJL_COMPANY_SERVICE> LIST_LIVE;
        protected IList<Model.NJL_COMPANY_SERVICE> LIST_PLAY;
        protected IList<Model.NJL_COMPANY_SERVICE> LIST_SHOP;

        protected void Page_Load(object sender, EventArgs e)
        {
        
                LoadData();
            
        }

        private void LoadData()
        {
            if (WEBSITE_FOCUS_CITY_CODE != "")
            {
                LIST_EAT = bll.GetModelList(5, " TYPE_CODE='1' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_LIVE = bll.GetModelList(5, " TYPE_CODE='2' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_PLAY = bll.GetModelList(5, " TYPE_CODE<>'1' and TYPE_CODE<>'2' and TYPE_CODE<>'20' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_SHOP = bll.GetModelList(5, " TYPE_CODE='20' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where AREA_CODE='" + WEBSITE_FOCUS_CITY_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
            }
            else
            {
                LIST_EAT = bll.GetModelList(5, " TYPE_CODE='1' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where NJL_SYS_BASE_ID='" + WEBSITE_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_LIVE = bll.GetModelList(5, " TYPE_CODE='2' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where NJL_SYS_BASE_ID='" + WEBSITE_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_PLAY = bll.GetModelList(5, " TYPE_CODE not in ('1','2','20') AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where NJL_SYS_BASE_ID='" + WEBSITE_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
                LIST_SHOP = bll.GetModelList(5, " TYPE_CODE='20' AND NJL_COMPANY_ID IN(select ID From NJL_COMPANY where NJL_SYS_BASE_ID='" + WEBSITE_CODE + "') ", "SORT DESC,VISIT_COUNT desc");
            }
        }
    }
}